﻿namespace HashFoo.Rest.Common
{
    /// <summary>
    /// A <see cref="IResource"/> that is used to get information from the remote application.
    /// </summary>
    /// <remarks>
    /// Queries can include filter and paging metadata.  See: <see cref="QueryMeta"/>.
    /// </remarks>
    /// <typeparam name="TResultModel">The type of object returned by the query</typeparam>
    public interface IQuery<TResultModel> : IResource, IHaveQueryMeta
    {
    }

    /// <summary>
    /// Defines common attributes to all resource queries.
    /// </summary>
    public interface IHaveQueryMeta
    {
        /// <summary>
        /// True if the query has meta data.
        /// </summary>
        bool HasQueryMeta { get; }

        /// <summary>
        /// The meta data (paging, sorting, filtering) for the query.
        /// </summary>
        QueryMeta QueryMeta { get; set; }        
    }
}